﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace Stock.出库信息
{
    public partial class OutStockAddAndEdit : Form
    {
        public OutStock f;
        public OutStockAddAndEdit()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {

            string GName = textBox1.Text;
            string DName = textBox2.Text;
            string CName = textBox3.Text;
            string OutNum = textBox4.Text;
            string sql = $"insert into Goods,Depot,Customer,OutStock values('{GName}','{DName}','{CName}','{OutNum}')";
            if (DBH.NoSelect(sql) > 0)
            {
                MessageBox.Show("添加成功！");
                f.dataGridView1.AutoGenerateColumns = false;
                f.dataGridView1.DataSource = DBH.Select("select * from Goods,Depot,Customer,OutStock");


            }
            else
            {
                MessageBox.Show("添加失败！");
            }
        }

        private void button2_Click(object sender, EventArgs e)
        {
            this.Close();
        }
    }
}
